package com.benhil.hrms.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToOne;

import org.codehaus.jackson.annotate.JsonIgnoreType;

@JsonIgnoreType
@Entity(name = "user")
public class User extends PersistentObject {
	
	@Column(nullable = false)
	private String username;
	
	@Column(nullable = false)
	private String password;
		
	@OneToOne(mappedBy = "user", cascade = {CascadeType.ALL})
	private Role role;
	
	@OneToOne(mappedBy = "user", cascade = {CascadeType.ALL})
	private Account account;

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}
	
}
